foo=cfssl;
if ! command -v ${foo} > /dev/null 2>&1 ; then echo "Command not found ${foo}."; exit 1; fi;
foo=cfssljson;
if ! command -v ${foo} > /dev/null 2>&1 ; then echo "Command not found ${foo}."; exit 1; fi;

cfssl gencert \
-ca=ca.pem \
-ca-key=ca-key.pem \
-config=ca-config.json \
-profile=kubernetes etcd-csr.json | cfssljson -bare etcd